<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
 Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="WindowFigure.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>WindowFigure.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'WindowFigure.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="draw2d/WindowFigure.html">draw2d.WindowFigure</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">/* This notice must be untouched at all times.

FreeGroup Draw2D 0.9.26
The latest version is available at
http://www.freegroup.de

Copyright (c) 2006 Andreas Herz. All rights reserved.
Created 5. 11. 2006 by Andreas Herz (Web: http://www.freegroup.de )

LICENSE: LGPL

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA,
or see http://www.gnu.org/copyleft/lesser.html
*/</span>

<span class="comment">/**
 * 
 * <span class="attrib">@version</span> 0.9.26
 * <span class="attrib">@author</span> Andreas Herz
 * <span class="attrib">@constructor</span>
 */</span>
draw2d.WindowFigure=<span class="reserved">function</span>(<span class="comment">/*:String*/</span> title)
{
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.title =title;
  <span class="comment">/** <span class="attrib">@private</span> **/</span>
  <span class="reserved">this</span>.titlebar=null;

  draw2d.Figure.call(<span class="reserved">this</span>);

  <span class="reserved">this</span>.dropShadow = 5;
  
  <span class="comment">// It is not possible to delete a window with the [DEL] key</span>
  <span class="comment">//</span>
  <span class="reserved">this</span>.setDeleteable(false);

  <span class="comment">// A window ignores the grid or geometry snapper</span>
  <span class="reserved">this</span>.setCanSnapToHelper(false);

  <span class="comment">// A window object should have the biggest z-order index.</span>
  <span class="reserved">this</span>.setZOrder(draw2d.WindowFigure.ZOrderIndex);
};

draw2d.WindowFigure.<span class="reserved">prototype</span> = new draw2d.Figure();

<span class="comment">/** <span class="attrib">@private</span> **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.type=<span class="literal">":draw2d.WindowFigure"</span>;


<span class="comment">/** <span class="attrib">@private</span> **/</span>
draw2d.WindowFigure.ZOrderIndex=50000;


<span class="comment">/**
 * Set the common z-index of the window element. This method exists for
 * compatibility reason to dojo or another UI javascript library. 
 * It is now ossible to arange the draw2d elements behind/before other UI elements-
 *
 * <span class="attrib">@see</span> #setZOrder
 * <span class="attrib">@static</span>
 * <span class="attrib">@param</span> {int} index The z-order for all new window objects.
 **/</span>
draw2d.WindowFigure.setZOrderBaseIndex=<span class="reserved">function</span>(<span class="comment">/*:int*/</span> index)
{
  draw2d.WindowFigure.ZOrderBaseIndex = index;
};

<span class="comment">/**
 * Return true if the origin of the Object is the window and not
 * the document. This is usefull if you want implement a window or a
 * dialog element. The element doesn't move if the user scroll the document.
 *
 * <span class="attrib">@returns</span> Returns [true] if the origin of the object the window.
 * <span class="attrib">@type</span> boolean
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.hasFixedPosition=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> true;
};

<span class="comment">/**
 * Return true if the window has a title bar
 *
 * <span class="attrib">@returns</span> Returns [true] if the window has a title bar
 * <span class="attrib">@type</span> boolean
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.hasTitleBar=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> true;
};

<span class="comment">/**
 * <span class="attrib">@private</span>
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.createHTMLElement=<span class="reserved">function</span>()
{
  var item = draw2d.Figure.<span class="reserved">prototype</span>.createHTMLElement.call(<span class="reserved">this</span>);
  item.style.margin=<span class="literal">"0px"</span>;
  item.style.padding=<span class="literal">"0px"</span>;
  item.style.border= <span class="literal">"1px solid black"</span>;
  item.style.backgroundImage=<span class="literal">"url(window_bg.png)"</span>;
  <span class="reserved">if</span>(<span class="reserved">this</span>.dropShadow&gt;0)
     item.style.boxShadow=<span class="reserved">this</span>.dropShadow+<span class="literal">"px "</span>+<span class="reserved">this</span>.dropShadow+<span class="literal">"px "</span>+<span class="reserved">this</span>.dropShadow+<span class="literal">"px #ccc"</span>;
  item.style.borderRadius = <span class="literal">"2px"</span>;
  
  item.style.zIndex=draw2d.WindowFigure.ZOrderIndex;
  item.style.cursor=null;
  item.className = <span class="literal">"WindowFigure"</span>;

  <span class="reserved">if</span>(<span class="reserved">this</span>.hasTitleBar())
  {
   <span class="reserved">this</span>.titlebar = document.createElement(<span class="literal">"div"</span>);
   <span class="reserved">this</span>.titlebar.style.position=<span class="literal">"absolute"</span>;
   <span class="reserved">this</span>.titlebar.style.left   = <span class="literal">"0px"</span>;
   <span class="reserved">this</span>.titlebar.style.top    = <span class="literal">"0px"</span>;
   <span class="reserved">this</span>.titlebar.style.width = <span class="reserved">this</span>.getWidth()+<span class="literal">"px"</span>;
   <span class="reserved">this</span>.titlebar.style.height = <span class="literal">"15px"</span>;
   <span class="reserved">this</span>.titlebar.style.margin = <span class="literal">"0px"</span>;
   <span class="reserved">this</span>.titlebar.style.padding= <span class="literal">"0px"</span>;
   <span class="reserved">this</span>.titlebar.style.font=<span class="literal">"normal 10px verdana"</span>;
   <span class="reserved">this</span>.titlebar.style.backgroundColor=<span class="literal">"blue"</span>;
   <span class="reserved">this</span>.titlebar.style.borderBottom=<span class="literal">"2px solid gray"</span>;
   <span class="reserved">this</span>.titlebar.style.whiteSpace=<span class="literal">"nowrap"</span>;
   <span class="reserved">this</span>.titlebar.style.textAlign=<span class="literal">"center"</span>;
   <span class="reserved">this</span>.titlebar.style.backgroundImage=<span class="literal">"url(window_toolbar.png)"</span>;
   <span class="reserved">this</span>.titlebar.className = <span class="literal">"WindowFigure_titlebar"</span>;
   <span class="reserved">this</span>.textNode = document.createTextNode(<span class="reserved">this</span>.title);
   <span class="reserved">this</span>.titlebar.appendChild(<span class="reserved">this</span>.textNode);

   <span class="reserved">this</span>.disableTextSelection(<span class="reserved">this</span>.titlebar);

   item.appendChild(<span class="reserved">this</span>.titlebar);
  }
  <span class="reserved">return</span> item;
};

<span class="comment">/** 
 * <span class="attrib">@private</span>
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setDocumentDirty=<span class="reserved">function</span>( <span class="comment">/*:draw2d.Figure*/</span> figure)
{
  <span class="comment">// a window can't invalidate a document.</span>
  <span class="comment">// Reason: Movement of a Dialog or Window is not relay a document modification.</span>
};

draw2d.WindowFigure.<span class="reserved">prototype</span>.onDragend = <span class="reserved">function</span>()
{
  <span class="comment">// do nothing</span>
};

<span class="comment">/**
 * Will be called if the object are move via drag and drop.
 * Don't override this method if you want avoid the drag and drob of your window.
 * Use the setCanDrag(false) method instead.&lt;br&gt;
 *
 * <span class="attrib">@param</span> {int} x x position of the mouse in the window
 * <span class="attrib">@param</span> {int} y y position of the mouse in the window
 * <span class="attrib">@returns</span> Returns [true] if the window can be draged. False in the other case
 * <span class="attrib">@type</span> boolean
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.onDragstart = <span class="reserved">function</span>(<span class="comment">/*:int*/</span> x, <span class="comment">/*:int*/</span> y)
{
  <span class="comment">// no titlebar =&gt; no drag drop</span>
  <span class="comment">// Reson: The titlebar is the DragDrop handle.</span>
  <span class="comment">//</span>
  <span class="reserved">if</span>(<span class="reserved">this</span>.titlebar===null)
    <span class="reserved">return</span> false;

  <span class="comment">// Return only true if the user klicks into the tilebar.</span>
  <span class="comment">// (Titlebar is the DragDrop handle for a window)</span>
  <span class="comment">//</span>
  <span class="reserved">if</span>(<span class="reserved">this</span>.canDrag===true &amp;&amp; x&lt;parseInt(<span class="reserved">this</span>.titlebar.style.width) &amp;&amp; y&lt;parseInt(<span class="reserved">this</span>.titlebar.style.height))
    <span class="reserved">return</span> true;

  <span class="comment">// add additional checks for the bottom/right resize handle</span>
  <span class="comment">// TODO</span>

  <span class="reserved">return</span> false;
};

<span class="comment">/**
 * <span class="attrib">@private</span>
 * <span class="attrib">@type</span> boolean
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.isSelectable=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> false;
};

<span class="comment">/**
 * Switch on/off the drag drop behaviour of this object
 * <span class="attrib">@param</span> {boolean} flag The flag which handles the drag drop behaviour of this window.
 *
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setCanDrag=<span class="reserved">function</span>(<span class="comment">/*:boolean*/</span>flag)
{
  draw2d.Figure.<span class="reserved">prototype</span>.setCanDrag.call(<span class="reserved">this</span>,flag);
  <span class="reserved">this</span>.html.style.cursor=<span class="literal">""</span>;
  <span class="reserved">if</span>(<span class="reserved">this</span>.titlebar===null)
    <span class="reserved">return</span>;

  <span class="reserved">if</span>(flag)
    <span class="reserved">this</span>.titlebar.style.cursor=<span class="literal">"move"</span>;
  <span class="reserved">else</span>
    <span class="reserved">this</span>.titlebar.style.cursor=<span class="literal">""</span>;
};


<span class="comment">/**
 * Will be called from the framework if the figure/window has been added to a Workflow 
 * instance.
 *
 * <span class="attrib">@private</span>
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setWorkflow= <span class="reserved">function</span>( <span class="comment">/*:draw2d.Workflow*/</span> workflow)
{
  var oldWorkflow = <span class="reserved">this</span>.workflow;
  draw2d.Figure.<span class="reserved">prototype</span>.setWorkflow.call(<span class="reserved">this</span>,workflow);
  <span class="reserved">if</span>(oldWorkflow!==null)
    oldWorkflow.removeSelectionListener(<span class="reserved">this</span>);
  <span class="reserved">if</span>(<span class="reserved">this</span>.workflow!==null)
    <span class="reserved">this</span>.workflow.addSelectionListener(<span class="reserved">this</span>);
};

<span class="comment">/**
 * Set the size of the drop shadow of the window.
 *
 * <span class="attrib">@param</span> {int} w new width of the window. 
 * <span class="attrib">@since</span> 0.9.26
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setDropShadow=<span class="reserved">function</span>(<span class="comment">/*:int*/</span> w)
{
    <span class="reserved">this</span>.dropShadow = w;
	<span class="reserved">if</span>(<span class="reserved">this</span>.html===null)
	   <span class="reserved">return</span>;
	   
	<span class="reserved">if</span>(<span class="reserved">this</span>.dropShadow&gt;0)
	    <span class="reserved">this</span>.html.style.boxShadow=w+<span class="literal">"px "</span>+w+<span class="literal">"px "</span>+w+<span class="literal">"px #ccc"</span>;
	<span class="reserved">else</span>
	    <span class="reserved">this</span>.html.style.boxShadow=<span class="literal">""</span>;
};

<span class="comment">/**
 * Set the new dimension of the window.
 *
 * <span class="attrib">@param</span> {int} w new width of the window. 
 * <span class="attrib">@param</span> {int} h new height of the window. 
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setDimension=<span class="reserved">function</span>(<span class="comment">/*:int*/</span> w, <span class="comment">/*:int*/</span> h)
{
  draw2d.Figure.<span class="reserved">prototype</span>.setDimension.call(<span class="reserved">this</span>,w,h);

  <span class="reserved">if</span>(<span class="reserved">this</span>.titlebar!==null)
    <span class="reserved">this</span>.titlebar.style.width=<span class="reserved">this</span>.getWidth()+<span class="literal">"px"</span>;
};

<span class="comment">/**
 * Set the new title / header of this dialog.
 *
 * <span class="attrib">@param</span> {String} title The new title of the window
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setTitle= <span class="reserved">function</span>(<span class="comment">/*:String*/</span> title)
{
  <span class="reserved">this</span>.title = title;
};

<span class="comment">/**
 * <span class="attrib">@type</span> int
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.getMinWidth=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> 50;
};

<span class="comment">/**
 * <span class="attrib">@type</span> int
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.getMinHeight=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> 50;
};

<span class="comment">/**
 *
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.isResizeable=<span class="reserved">function</span>()
{
  <span class="reserved">return</span> false;
};


<span class="comment">/**
 * Avoid the alpha blending during the drag and drop of an window. This will only cost 
 * performance and I think this is importand.
 * <span class="attrib">@private</span>
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setAlpha=<span class="reserved">function</span>(percent <span class="comment">/*:int 0-1*/</span>)
{
  <span class="comment">// sieht nicht gut aus bei einem Fenster und kostet nur Resourcen</span>
};

<span class="comment">/**
 * Set the background color of the window.
 * <span class="attrib">@param</span> {draw2d.Color} color The new background color of the object.
 *
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setBackgroundColor= <span class="reserved">function</span>(<span class="comment">/*:draw2d.Color*/</span> color)
{
  <span class="reserved">this</span>.bgColor = color;
  <span class="reserved">if</span>(<span class="reserved">this</span>.bgColor!==null)
    <span class="reserved">this</span>.html.style.backgroundColor=<span class="reserved">this</span>.bgColor.getHTMLStyle();
  <span class="reserved">else</span>
  {
    <span class="reserved">this</span>.html.style.backgroundColor=<span class="literal">"transparent"</span>;
    <span class="reserved">this</span>.html.style.backgroundImage=<span class="literal">""</span>;
  }
};

<span class="comment">/**
  * <span class="attrib">@param</span> {draw2d.Color} color The new border color of the window.
  *
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setColor= <span class="reserved">function</span>(<span class="comment">/*:draw2d.Color*/</span> color)
{
  <span class="reserved">this</span>.lineColor = color;
  <span class="reserved">if</span>(<span class="reserved">this</span>.lineColor!==null)
   <span class="reserved">this</span>.html.style.border= <span class="reserved">this</span>.lineStroke+<span class="literal">"px solid "</span>+<span class="reserved">this</span>.lineColor.getHTMLStyle();
  <span class="reserved">else</span>
   <span class="reserved">this</span>.html.style.border= <span class="literal">"0px"</span>;
};


<span class="comment">/**
 * mmmh, make this sense? 
 * Line width has beend mapped to the border width. 
 * TODO: Implement a propper setBorder() method for the window.
 *
 * <span class="attrib">@param</span> {int} w The new border width of the window.
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.setLineWidth=<span class="reserved">function</span>(<span class="comment">/*:int*/</span> w)
{
  <span class="reserved">this</span>.lineStroke=w;
  <span class="reserved">this</span>.html.style.border= <span class="reserved">this</span>.lineStroke+<span class="literal">"px solid black"</span>;
};

<span class="comment">/**
 * Call back method of the framework if the selected object has been changed.
 *
 * <span class="attrib">@param</span> {draw2d.Figure} figure the object which has been selected or null.
 * <span class="attrib">@param</span> {draw2d.AbstractObjectModel} model the corresponding model of the figure or null
 **/</span>
draw2d.WindowFigure.<span class="reserved">prototype</span>.onSelectionChanged=<span class="reserved">function</span>(<span class="comment">/*:draw2d.Figure*/</span> figure, <span class="comment">/*:draw2d.AbstractObjectModel*/</span> model)
{
};

</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b></b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Mon Nov 14 13:45:39 2011</div>
</body>
</html>
